#pragma once

#include <QObject>
enum HttSendReturnVal {
	send_ok = 0,
	send_param_error = 1,
	send_failed = 2,

	send_timeout = 99,
};


class HttpSend : public QObject
{
	Q_OBJECT

public:
	HttpSend(QObject* parent);

	~HttpSend();
	/*******************************************************************************
	* http 消息发送接口(POST方法)
	* 参数：path：http消息路径, data: 消息内容， ans:返回参数消息回复内容，log:是否需要打印日志
	********************************************************************************/
	static int SendPostMsgByHttp(const QString& path, const QByteArray& data, QByteArray& ans, bool log = true);
	static int SendGetMsgByHttp(const QString& path, QByteArray& ans);
};
